package com.sweetsourfish.crm.activity.service.impl;

import com.sweetsourfish.crm.activity.mapper.ActivityRemarkMapper;
import com.sweetsourfish.crm.activity.model.ActivityRemark;
import com.sweetsourfish.crm.activity.service.ActivityRemarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 市场活动接口service实现层
 * @Version: 1.0
 */
@Service
public class ActivityRemarkServiceImpl implements ActivityRemarkService {

    /**
     * Description: 注入Mapper
     */
    @Autowired
    private ActivityRemarkMapper activityRemarkMapper;

    /**
     * Description: 查询备注
     * @param id  根据id查询备注详细
     * @return 详细备注
     */
    @Override
    public List<ActivityRemark> queryActivitiesById(String id) {
        return activityRemarkMapper.selectByIdAndActivityId(id);
    }

    /**
     * Description: 添加备注
     * @param activityRemark  实体类
     * @return 添加条数
     */
    @Override
    public int addActivityRemark(ActivityRemark activityRemark) {
        return activityRemarkMapper.insertActivityRemark(activityRemark);
    }

    /**
     * Description: 删除备注
     * @param removeId  删除的id
     * @return  删除
     */
    @Override
    public int removeActivityRemark(String removeId) {
        return activityRemarkMapper.deleteActivityRemark(removeId);
    }

    /**
     * Description: 修改备注
     * @param activityRemark  实体类
     * @return 修改
     */
    @Override
    public int saveActivityRemark(ActivityRemark activityRemark) {
        return activityRemarkMapper.updateActivityRemark(activityRemark);
    }
}
